#pragma once

#include "HXTTSEngine.h"
#include "MaryClient.h"
#include "HXUtil.h"

class HXTTSEngineMary : public HXTTSEngine
{
public:
	HXTTSEngineMary(void);
	//HXTTSEngineMary(int fps, double visemeModulator, double rate);
	~HXTTSEngineMary(void);

private:

	// functions to override
	HRESULT GenerateSpeech(const wstring& text, string& audio, vector<vector<HXViseme>>& frames);
	void    GetVoices(vector<string>& voices);
	void    SetVoice(string& voice);
	void    SetEffect(string& effect, string& value);


	MaryClient* m_client;

	void internal_SetRate(double rate);
	void parse(const string& realised_durations, vector<vector<HXViseme>>& visemeSequence);
	void tokenize(const string& str, vector<string>& tokens, const string& delimiters);
	
	
	string m_voiceName, m_effect;
	const char* m_host;
	int m_port;
};
